const { defineConfig } = require('@vue/cli-service')
const packageName = require("./package.json").name;

module.exports = defineConfig({
  transpileDependencies: true,
  outputDir: `../dist/${packageName}`,
  publicPath: process.env.VUE_APP_BASE_URL,
  configureWebpack:{
    output: {
      library: `${packageName}-[name]`,
      libraryTarget: 'umd', // 把微应用打包成 umd 库格式
    },
  },
  devServer: {
    host: '0.0.0.0',
    port: 10050,
    hot: true,
    headers: {
      'Access-Control-Allow-Origin': '*',// 主应用获取子应用时跨域响应头
      "Access-Control-Allow-Headers": "*",
      "Access-Control-Allow-Methods": "*",
    },
  }
})
